<%--
  Created by IntelliJ IDEA.
  User: asus
  Date: 2020/5/28
  Time: 8:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="true" %>
<html>
<head>
    <title>库存预警</title>
    <%@include file="/comm/head.jsp"%>
</head>
<body>
<div id="root">
    <i-table :columns="columns" :data="pageResult.rows"  :height="300"  border stripe style="margin-top: 50px">

    </i-table>

    <card >
            <i-button type="error">发送警报邮件</i-button>
    </card>

    <Page :total="pageResult.total"
          :page-size="pageSize"
          @on-change="pageNo=arguments[0];search();"
          show-sizer
          :page-size-opts="[5,10,15]"
          @on-page-size-change="pageSize=arguments[0];search();"
    />
</div>
<script>
    new Vue({
        el: "#root",
        data: {
            columns:[
                // {type:"selection",width:60,align:"center"},//自动开启多选功能
                { key:"id",title:"编号"},
                {key:"name",title:"商品名称"},
                {key:"storenum",title:"库存数量"},
                {key:"outnum",title:"待发货数量"}
            ],
            pageResult:{
                rows:[],
                total:50
            },
            pageNo:1,
            pageSize:5,
            KuCuiYvJing:{}

        },
        methods:{
            search(){
                axios.get(`${ctx}/sys/kuCun/search/${this.pageNo}/${this.pageSize}`,{params:this.KuCuiYvJing})
                    .then(({data})=>{
                        this.pageResult=data.result;
                    });
            },
        },
        mounted(){
            this.search();
        }
    });
</script>
</body>
</html>
